package com.hliushi.chain.example01_wrong;

/**
 * 财务总监CFO (10000审批权限)
 *
 * @author: hliushi
 * @date: 2023/2/16 22:00
 **/
public class CFO {

    private final int MAX_AMOUNT = 10000;
    private String name;

    public CFO(String name) {
        this.name = name;
    }

    public boolean approve(int amount) {
        if (amount <= MAX_AMOUNT) {
            System.out.printf("审批通过。【总监: %s】\n", name);
            return true;
        } else {
            System.out.printf("驳回申请。【总监: %s】\n", name);
            return false;
        }
    }
}
